<?php
/**
 * 系统常量
 */

namespace App\Service;

use AlibabaCloud\SDK\OSS\OSS\SelectObjectRequest\body\selectRequest;
use phpDocumentor\Reflection\Types\Self_;

/**
 * 定义 常量、静态数据
 * 状态等固定Key value 可以重复使用
 * 其他类型列表常量命名方式 需表名{admin_user}+{type}+{list} 如：admin_user_list=[]
 * Class ParamsService
 * @package App\Service
 */
class ParamsService
{
    //-------------审核状态---------------
    const AUDIT_STATUS_WAIT = 0;
    const AUDIT_STATUS_ALLOW = 1;
    const AUDIT_STATUS_DENY = 2;
    public static array $audit_status = [
        self::AUDIT_STATUS_WAIT => '待审核',
        self::AUDIT_STATUS_ALLOW => '审核通过',
        self::AUDIT_STATUS_DENY => '审核拒绝',
    ];
    //-------------状态---------------
    const STATUS_DISABLE = 0;
    const STATUS_ENABLE = 1;
    public static array $status = [
        self::STATUS_ENABLE => '启用',
        self::STATUS_DISABLE => '停用',
    ];
    //显示状态
    const DISPLAY_ENABLE = 1;
    const DISPLAY_DISABLE = 2;

    public static array $display = [
        self::DISPLAY_ENABLE => "显示",
        self::DISPLAY_DISABLE => "隐藏"
    ];

    const STATUS_NO = 0;
    const STATUS_YES = 1;
    public static array $need = [
        self::STATUS_NO => '否',
        self::STATUS_YES => '是',
    ];
    //性别
    const SEX_UNKNOWN = 0;
    const SEX_MAN = 1;
    const SEX_WOMAN = 2;
    public static array $sex = [
        self::SEX_UNKNOWN => '未知',
        self::SEX_MAN => '男',
        self::SEX_WOMAN => '女'
    ];
    const SOURCE_WEB = 1;
    const SOURCE_API = 2;
    public static array $admin_login_log_source = [self::SOURCE_WEB => '网页', self::SOURCE_API => '接口'];

    const NAV = 'nav';//首页导航
    const MEMBER_AGREEMENT = 'member_agreement';//用户协议
    const PRIVACY_POLICY = 'privacy_policy';//隐私政策
    const LAUNCH = 'launch';//启动页配置
    const APP_TIME = 'app_time';//APP退出时间

    public static array $config_item_list = [
        self::NAV => ['name' => '首页导航'],
        self::PRIVACY_POLICY => ['name' => '隐私政策', 'type' => 'fulltext'],
        self::MEMBER_AGREEMENT => ['name' => '用户协议', 'type' => 'fulltext'],
        self::LAUNCH => ['name' => '启动页'],
    ];

    //----------初始化角色-----------
    const ADMIN_USER_ROLE_SYSTEM = '系统管理员';
    public static array $admin_user_role_init = [
        self::ADMIN_USER_ROLE_SYSTEM,
    ];

    //----------字典项-----------
    const DICT_PAY_TYPE = 'pay_type';
    public static array $dict_item_list = [
        self::DICT_PAY_TYPE => '支付方式',
    ];

    //----------菜单-----------
    const TYPE_MENU_MENU = 'menu';
    const TYPE_MENU_IFRAME = 'iframe';
    const TYPE_MENU_LINK = 'link';
    const TYPE_MENU_BUTTON = 'button';
    public static array $admin_menu_type = [
        self::TYPE_MENU_MENU => "菜单",
        self::TYPE_MENU_IFRAME => "Iframe",
        self::TYPE_MENU_LINK => "外链",
        self::TYPE_MENU_BUTTON => "按钮"
    ];
    //----------角色权限-----------
    const ADMIN_USER_POWER_TYPE_MENU = 1;
    public static array $admin_user_power_type = [
        self::ADMIN_USER_POWER_TYPE_MENU => "菜单",
    ];
    const ADMIN_USER_ROLE_PERMISSIONS_SELF = 1;
    const ADMIN_USER_ROLE_PERMISSIONS_ALL = 5;
    public static array $admin_user_role_data_type = [
        self::ADMIN_USER_ROLE_PERMISSIONS_SELF => "本人可见",
        self::ADMIN_USER_ROLE_PERMISSIONS_ALL => "全部可见",
    ];
}
